<template>
  <!-- 积分信息 -->
  <div>
    <div class="content-box">
      <div class="title">
        <div class="col-xs-6">积分信息</div>
        <div class="col-xs-6" style="text-align: right;">
          <i class="glyphicon glyphicon-pencil" style="cursor: pointer;"></i>
        </div>
      </div>

      <el-form ref="form" label-width="120px">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="积分：">
              {{detail.patientScore}}
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <!-- <table border="0" class="basic_table" width="100%">
        <tr height="40">
          <td>积分：</td>
          <td colspan="3">{{detail.patientScore}}</td>
        </tr>
      </table> -->
    </div>
    <table class="table-box">
      <thead>
        <tr>
          <th>变动类型</th>
          <th>时间</th>
          <th>变动前积分</th>
          <th>数据</th>
          <th>备注</th>
        </tr>
      </thead>
      <tbody>
        <tr v-for="(item,index) in tableList" :key="index">
          <td>{{item.source | changeSource}}</td>
          <td>{{item.gmtCreate | changeTime}}</td>
          <td>{{item.beforeNum}}</td>
          <td>{{item.afterNum}}</td>
          <td>{{item.desc}}</td>
        </tr> 
      </tbody>
    </table>
    <div v-if="tableList.length == 0" style="color:#999;padding:10px 0;text-align:center;">
      <i class="iconfont iconwushuju" style="font-size:40px;"></i>
      <div>暂无数据</div>
    </div>
  </div>
</template>
<script>
export default {
  props: ["detail"],
  data() {
    return {
      curItem: null,
      tableList: [],
      pager: { pageSize: 10, pageNum: 1, total: 0 }
    };
  },
  mounted() {
    let th = this;
    th.getData();
  },
  methods: {
    getData() {
      let th = this;
      let uid = th.jieMi(th.$route.query.id);
      th.$api
        .getIntegralRecord({ hpId: th.adminUser.hpId, patientId: uid })
        .then(res => {
          if (res.executed) {
            th.tableList = res.dataBody.list;
            th.pager.total = res.dataBody.total;
          }
        });
    }
  },
  components: {}
};
</script>
<style lang="scss" scoped>
@import "../_css/detail.scss";
.content-box {
  border: none;
}
.visit_detail_box .content-box .title {
  background: none;
  padding-left: 0;
}
.visit_detail_box .content-box table {
  border: none;
}
</style>

